/*
 
    Copyright (c) 2010 Jeffrey Dik <s450r1@gmail.com>
    Copyright (c) 2010 Martin Sustrik <sustrik@250bpm.com>
    Copyright (c) 2010 Ralf Westphal <info@ralfw.de>
     
    This file is derived from clrzmq and is part of NZMQ, nzmq.codeplex.com.
     
    clrzmq and NZMQ are free software; you can redistribute it and/or modify it under
    the terms of the Lesser GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
     
    clrzmq and NZMQ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    Lesser GNU General Public License for more details.
     
    You should have received a copy of the Lesser GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

*/

using System;
using System.Runtime.InteropServices;

namespace nzmq
{
    [Serializable]
    public class NzmqException : Exception
    {
        private readonly int errno;


        public NzmqException() : base(Marshal.PtrToStringAnsi(libzmq.zmq_strerror(libzmq.zmq_errno())))
        {
            this.errno = libzmq.zmq_errno();
        }


        public int Errno
        {
            get { return errno; }
        }
    }
}